package midware

import (
	"925/api/pkg"
	"github.com/gin-gonic/gin"
)

func Parse() gin.HandlerFunc {
	return func(c *gin.Context) {
		value := c.GetHeader("token")
		userId, isVip, _ := pkg.GetToken(value)
		c.Set("userId", userId)
		c.Set("isVip", isVip)
		c.Next()
	}
}
